<!doctype html>
<html lang="en"><head>
    <meta charset="utf-8">
    <title>抽奖</title>
    <link rel="shortcut icon" href="/static/favicon.ico"/>
    <link rel="stylesheet" type="text/css" href="/static/front/fonts/iconfont.css">
    <link rel="stylesheet" type="text/css" href="/static/front/css/base_new.css">
    <link rel="stylesheet" type="text/css" href="/static/front/css/library.css">
    <link rel="stylesheet" type="text/css" href="/static/front/css/style.css">
    <link rel="stylesheet" type="text/css" href="/static/front/css/main.css">
    <link rel="stylesheet" type="text/css" href="/static/front/css/share.css">
    <script type="text/javascript" src="/static/front/js/jquery-1.11.1.min.js"></script>
    <script type="text/javascript" src="/static/front/js/jquery.countdown.js"></script>
    <script type="text/javascript" src="/static/front/js/js.js"></script>
    <script type="text/javascript" src='/static/front/js/awardRotate.js'></script>
</head>
<body bgcolor="#f5f5f5">
<div class="content">
	<#include "../base/top.ftl" />
	<div class="Luck-draw">
	        <div class="Luck-draw-lc"></div>
	        <div class="Luck-draw-name">
	            <div class="Luck-draw-list clear">
	                <span class="fl">最新中奖名单：</span>
	                <div id="Marquee_x" style="overflow:hidden;width:955px;">
	                <ul class="fl">
	                	<#if drawList?exists>
	                		<#list drawList as model>
	                		<!--<#if model.remark?? && model.remark?length gt 7>${model.remark[5..7]}</#if>-->
	                			<li><a style="font-size:22px;"><i>${model.username[0..0]}***${model.username[model.username?length-1..model.username?length-1]}</i></a></li>
	                		</#list>
	                	</#if>
	                	
	                  <!--<li><a style="font-size:22px;">一等奖start<i>n***8</i></a></li>
	                  <li><a style="font-size:22px;">三等奖2<i>n***8</i></a></li>
	                  <li><a style="font-size:22px;">六等奖3<i>n***8</i></a></li>
	                  <li><a style="font-size:22px;">五等奖4<i>n***8</i></a></li>
	                  <li><a style="font-size:22px;">二等奖end<i>n***8</i></a></li>-->
	                </div>  
	            </div>
	        </div>
	        <div class="start-draw">
	            <div class="start-draw-content clear">
	                <div class="start-draw-text fl">
	                    <i style="text-align:right;padding-right:20px;">”</i>
	                    <span style="margin-left:50px;margin-top:20px;">积分大抽奖，即刻来抽吧</span>
	                    <h3>888元现金等你拿</h3>
	                    <span style="margin-top:20px;">抽奖方式：积分商城—抽奖兑换—立即抽奖</span>
	                    <i style="margin-top:10px;font-size:45px;margin-left:-40px;">“</i>
	                </div>
	                <div class="start-draw-box fl">
	                    <!-- 转盘抽奖 start -->
	                     <div class="turntable-bg">
	                        <div class="pointer">
	                          <img src="${_front_images}/pointer.png" style="cursor: pointer;" alt="pointer">
	                        </div>
	                        <div class="rotate" >
	                          <img id="rotate" src="${_front_images}/turntable1.png" alt="turntable" width='100%' height='100%'>
	                        </div>
	                      </div>
	                      <!-- 转盘抽奖 end -->
	                      <span class="start-draw-ps">小伙伴们快来吧抽到你手软哦</span>
	                </div>
	            </div>
	            <h3 class="draw-name">如何参加抽奖</h3>
	            <div class="draw-details clear">
	                <div class="draw-details-content fl">
	                    <div class="draw-details-text">
	                        <span>1.登录后点击“开始抽奖”即可参与抽奖</span> 
	                        <span>2.每次抽奖扣除积分：300分</span>
	                        <span>3.每天最多抽奖次数：20次</span>
	                        <span>4.奖金等级：</span>
	                    </div>
	                    <ul>
	                      <li>
	                        <span>等级</span><span class="on1">金额（元）</span>
	                      </li>
	                      <li>
	                        <span>特等奖</span><span class="on1">888</span>
	                      </li>
	                      <li>
	                        <span>一等奖</span><span class="on1">88</span>
	                      </li>
	                      <li>
	                        <span>二等奖</span><span class="on1">28</span>
	                      </li>
	                      <li>
	                        <span>三等奖</span><span class="on1" >8</span>
	                      </li>
	                      <li>
	                        <span>四等奖</span><span class="on1">2</span>
	                      </li>
	                      <li>
	                        <span>五等奖</span><span class="on1">1</span>
	                      </li>
	                    </ul>
	                </div>
	                <div class="draw-details-content rt" style="margin-right:55px;margin-left:0;">
	                     <div class="draw-details-text">
	                        <span>5.中奖奖金及时到账，可在“我的账户”—“资金明细”中查看</span> 
	                        <span>6.积分获取规则：</span>
	                        <span>根据所投标的时间积分</span>
	                    </div>
	                    <ul>
	                      <li>
	                        <span>标</span><span class="on1">积分</span>
	                      </li>
	                      <li>
	                        <span>天标（<30天）</span><span class="on1">300元积1分</span>
	                      </li>
	                      <li>
	                        <span>月标（1-3个月）</span><span class="on1">100元积1分</span>
	                      </li>
	                      <li>
	                        <span>月标（4-6个月）</span><span class="on1">50元积1分</span>
	                      </li>
	                      <li>
	                        <span>月标（7-12个月）</span><span class="on1">20元积1分</span>
	                      </li>
	                      <li>
	                        <span></span><span></span>
	                      </li>
	                    </ul>
	                    <p class="draw-details-text"><span>7.最终解释权归武汉迅泊达金融服务有限公司所有</span></p>
	                </div>
	            </div>
	        </div>
	</div>
    <div id="footer">
        <div class="content">
			<#include "../base/foot.ftl" />
        </div>
    </div>
</div>	 
</body>
<script type="text/javascript" src="${_front_js}/layer/layer.js" ></script>
<script type="text/javascript" src="${_front_js}/jQuery-jcMarquee.js" ></script> 
</html>    
<!-- 转盘抽奖 start -->
    <script type='text/javascript'>
	    $(function(){
			$('#Marquee_x').jcMarquee({ 'marquee':'x','margin_right':'10px','speed':20});
		});
        $(function (){
            var rotateTimeOut = function (){
                $('#rotate').rotate({
                    angle:0,
                    animateTo:2160,
                    duration:8000,
                    callback:function (){
                        alert('网络超时，请检查您的网络设置！');
                    }
                });
            };
            var bRotate = false;

            var rotateFn = function (awards, angles, txt){
                bRotate = !bRotate;
                $('#rotate').stopRotate();
                $('#rotate').rotate({
                    angle:0,
                    animateTo:angles+1800,
                    duration:8000,
                    callback:function (){
						layer.alert(txt,function(index){
	                		layer.close(index);
	                		bRotate = !bRotate;
	                		window.location.reload();
	                	});                        
                        
                    }
                })
            };

            $('.pointer').click(function (){
               var uid = "<#if _user??>${_user.id}</#if>";
               $('.pointer').unbind("click"); //移除click
		       $.ajax({
		            type: "post", 
		            dataType: "json", 
		            url: "/draw",
		            success: function (result) {
		                if(result.code == -1){
		                	var item=result.entity;
			                switch (item) {
			                    case 0:
			                        rotateFn(2, 58, '获得1元现金');
			                        break;                
			                    case 1:
			                        rotateFn(1, 115, '获得2元现金');
			                        break;
			                    case 2:
			                        rotateFn(2, 178, '获得8元现金');
			                        break;
			                    case 3:
			                        rotateFn(3, 242, '获得28元现金');
			                        break;
			                    case 4:
			                        rotateFn(4, 296, '获得88元现金');
			                        break;
			                    case 5:
			                        rotateFn(5, 358, '获得888元现金');
			                        break;                        
			                }
		                }else{
		                	layer.alert(result.msg,function(index){
		                		layer.close(index);
		                		if(result.code==1){
		                			window.location.href="/login";
		                		}
		                	});
		                }
		            }
		       })

            });
        });
    </script>
    <!-- 转盘抽奖 end -->

